package com.dkd.day20250616;

public class Solutionsolve {
    public static void main(String[] args) {
        String s1 ="abcde";
        System.out.println(s1);
        String s2 =solve(s1);
        for(int i=0; i<s2.length(); i++){
            System.out.print(s2.charAt(i));

        }
        int [] test ={78,99,222};
        System.out.println(String.valueOf(test));
        System.out.println();
    }
    public static String solve (String str) {
        // write code here
        //反转字符串
        char[] arr = new char[str.length()];
        int left = 0;
        int right = str.length() - 1;
        while (left <= right) {
            arr[left] = str.charAt(right);
            arr[right] =str.charAt(left);
            left++;
            right--;
        }
    return String.valueOf(arr);
    }
}
